import { getAsyncPage } from '@/utils/asyncComponentLoader'
import { link, path } from 'd3'

export default {
    path: 'device-center',
    name: 'DeviceCenter',
    meta: {
        icon: 'device',
        title: '设备中心',
    },
    children: [{
        path: 'console',
        name: 'Console',
        component: getAsyncPage(() => import('@/components/nav/RouteCards.vue')),
        meta: {
            title: '控制台',
        },
        children: [{
            path: 'automation-control',
            name: 'AutomationControl',
            component: getAsyncPage(() => import('@/views/DeviceCenter/Console/AutomationControl/index.vue')),
            meta: {
                title: '自动化控制',
                menu: '控制台',
                icon: 'auto',
                permission: ['control_device']
            }
        }, {
            path: 'space-control',
            name: 'SpaceControl',
            component: getAsyncPage(() => import('@/views/DeviceCenter/Console/SpaceControl/index.vue')),
            meta: {
                title: '空间控制',
                icon: 'space',
                menu: '控制台',
                permission: ['control_device']
            }
        }]
    }, {
        path: 'device-info',
        name: 'DeviceInfo',
        component: getAsyncPage(() => import('@/views/DeviceCenter/DeviceInfo/index.vue')),
        meta: {
            title: '设备信息',
            permission: ['view_device_info']
        }
    }, {
        path: 'device-architecture',
        name: 'DeviceArchitecture',
        component: getAsyncPage(() => import('@/views/DeviceCenter/DeviceArchitecture/index.vue')),
        meta: {
            title: '设备架构',
            permission: ['view_device_architecture']
        }
    }, {
        path: 'device-monitor',
        name: 'DeviceMonitor',
        component: getAsyncPage(() => import('@/components/nav/RouteCards.vue')),
        meta: {
            title: '设备监控',
        },
        children: [{
            path: 'meter-management',
            name: 'WaterMeterManagement',
            component: getAsyncPage(() => import('@/views/DeviceCenter/Console/MeterManagement/index.vue')),
            meta: {
                title: '水表',
                icon: 'waterMeter',
                menu: '设备监控',
                linkExtra: {
                    type: 1
                },
                permission: ['manage_device', 'view_device_info']
            }
        }, {
            path: 'meter-management',
            name: 'ElectricityMeterManagement',
            component: getAsyncPage(() => import('@/views/DeviceCenter/Console/MeterManagement/index.vue')),
            meta: {
                title: '电表',
                icon: 'electricityMeter',
                menu: '设备监控',
                linkExtra: {
                    type: 2
                },
                permission: ['manage_device', 'view_device_info']
            }
        }, {
            path: 'offline-error-devices',
            name: 'OfflineErrorDevices',
            component: getAsyncPage(() => import('@/views/DeviceCenter/Console/OfflineErrorDevices/index.vue')),
            meta: {
                title: '离线故障设备',
                menu: '设备监控',
                icon: 'offline',
                permission: ['view_device_info']
            }
        }],
        meta: {
            title: '设备监控',
            permission: ['view_device_monitor']
        }
    }]
}